<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateBlackListsTable extends Migration
{
    /**
     * Run the migrations.
     *  正则匹配  REGEXP  $
     * @return void
     */
    public function up()
    {
        Schema::create('black_lists', function (Blueprint $table) {
            $table->id();
            $table->string('name')->default('')->comment('用户黑名单名称');
            $table->string('phone')->default('')->comment('电话号码');
            $table->string('id_card')->default('')->comment('身份证号码');
            $table->tinyInteger('type')->default(1)->comment('黑名单类型 1欠租、2诈骗、3抵押、4其他');
            $table->softDeletes();
            $table->timestamps();
        });
        \DB::statement("ALTER TABLE `black_lists` comment '用户黑名单'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('black_lists');
    }
}
